#include "uploadlayout.h"

#include <QWidget>

UploadLayout* UploadLayout::instance = new UploadLayout;
UploadLayout::AutoRelease UploadLayout::_at;

UploadLayout *UploadLayout::getInstance()
{
    return instance;
}

void UploadLayout::setUploadLayout(QWidget *p)
{
    m_wg = new QWidget(p);
    QLayout* layout = p->layout();
    layout->addWidget(m_wg);
    layout->setContentsMargins(0, 0, 0, 0);

    QVBoxLayout* vlayout = new QVBoxLayout;
    m_wg->setLayout(vlayout);
    vlayout->setContentsMargins(0, 0, 0, 0);
    m_layout = vlayout;

    // 添加弹簧
    vlayout->addStretch();
}

QLayout *UploadLayout::getUploadLayout()
{
    return m_layout;
}
